<?php 
	include("ajaxinlcudes.php");
	
	$rs = searchContent($_GET['rel']);
	$c=true;
	if(isset($_GET['c']))
	{
		$c=false;
		$radioName=$_GET['c'];
		}
$row_rs_relatepage = mysql_fetch_assoc($rs);
$total = mysql_num_rows($rs);
if($total>0){	
?>
 <table width="100%" border="0" cellpadding="4" cellspacing="0">
     <tr>
    <th>Page Title</th>
    <th> <?php  if(!$c) { ?>
        <input type="radio" name="<?php echo $radioName; ?>"  value="" />
        <?php } ?></th>
  </tr>
    <?php do { ?>
    <tr>
      <td width="84%"><a href="?page=content&itemid=<?php echo $row_rs_relatepage['content_id']; ?>"><?php echo $row_rs_relatepage['page_title']; ?></a></td>
      <td width="16%">
      <?php  if($c) {?>
        <input type="checkbox" name="rpage_<?php echo $row_rs_relatepage['content_id']; ?>" id="rpage_<?php echo $row_rs_relatepage['content_id']; ?>" value="<?php echo $row_rs_relatepage['content_id']; ?>" />
        <?php } else { ?>
        <input type="radio" name="<?php echo $radioName; ?>" id="rpage_<?php echo $row_rs_relatepage['content_id']; ?>" value="<?php echo $row_rs_relatepage['content_id']; ?>" <?php if($_GET["check"]== $row_rs_relatepage['content_id']) echo "checked='checked'";?> />
        <?php } ?>
        </td>
    </tr>
    <?php } while ($row_rs_relatepage = mysql_fetch_assoc($rs)); ?>
  </table>

<?php 
}else{
	echo "<div class='error'>No match FOUND</div>";
	}
	
?>
<?php
mysql_free_result($rs);
?>
